package com.hulk.ratel.manage.wx.util;


import com.github.binarywang.wxpay.config.WxPayConfig;
import lombok.experimental.UtilityClass;


import java.io.File;

/**
 * @author: hulk
 * @date: 17/8/25
 * @description:
 */
@UtilityClass
public class WxPayUtil {

    /**
     * 获取微信支付配置
     * @return
     */
    public  WxPayConfig getWxPayConfig(String mchId, String appId, String tradeType, String key, String signType, String keyPath, String notifyUrl) {
        WxPayConfig wxPayConfig = new WxPayConfig();

        wxPayConfig.setMchId(mchId);
        wxPayConfig.setAppId(appId);
        //设置classpath:路径
        wxPayConfig.setKeyPath(keyPath);
        wxPayConfig.setMchKey(key);
        wxPayConfig.setSignType(signType);
        wxPayConfig.setNotifyUrl(notifyUrl);
        wxPayConfig.setTradeType(tradeType);
        return wxPayConfig;
    }

    /**
     * 获取微信支付配置
     * @return
     */
    public  WxPayConfig getWxPayConfig(String mchId, String appId, String key) {
        WxPayConfig wxPayConfig = new WxPayConfig();
        wxPayConfig.setMchId(mchId);
        wxPayConfig.setAppId(appId);
        wxPayConfig.setMchKey(key);
        return wxPayConfig;
    }

}
